<template>
	<view class="wrapper">
		<uni-nav-bar leftIcon="back" @clickLeft="$back" rightText="清空" title="最新评论&赞" @clickRight="clearNews" backgroundColor="#f3f3f3"></uni-nav-bar>
		<view class="main">
			<view class="rating_box center" v-for="(val,index) in ratingList" :key='val.messageId'>
				<dimg :src="val.fromUserId | avatar" mode="aspectFill" class="avatar" @tap="$open('../friend/friend?userId='+val.fromUserId)"></dimg>
				<view class="main flex center">
					<view class="rating_user flex">
						<view class="f26 user_name">{{val.fromUserName}}</view>
						<image src="../../static/find/lick.png" mode="aspectFill" class="like_img rating_text" v-if="val.type==301"></image>
						<view class="rating_text f26" v-if="val.type==302">{{val.content}}</view>
						<view class="f22 c666">{{val.createTime | timediff}}</view>
					</view>
					<!-- <image src="../../static/delet/QQ截图20200415110521.png" mode="scaleToFill" class="rating_img"></image> -->
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue';
export default {
	data() {
		return {
			ratingList:[]
		};
	},
	components: { uniNavBar },
	onShow() {
		uni.setStorageSync('ratingNum',0)
		this.ratingList=uni.getStorageSync('ratingList')
	},
	methods: {
		clearNews(){
			uni.setStorageSync('ratingList',[])
			this.ratingList=[]
		}
	}
};
</script>

<style lang="scss">
.rating_box {
	padding: 0 30rpx;
	.ctheme {
		color: #516aad;
	}
	.rating_img {
		width: 112rpx;
		height: 112rpx;
	}
	.main {
		border-bottom: 1rpx solid #e0e0e0;
		padding: 20rpx 0;
	}
	.user_name {
		color: #516aad;
	}
	.rating_text {
		padding: 10rpx 0;
	}
	.like_img {
		width: 25rpx;
		height: 25rpx;
	}
	.avatar {
		width: 76rpx;
		height: 76rpx;
		border-radius: 50%;
		margin-right: 15rpx;
		overflow: hidden;
	}
}
</style>
